package day16.homework13;

class Animal { 
    public void speak() { 
    System.out.println("I am an animal."); 
} 
} 

    class Dog extends Animal { 
    @Override 
    public void speak() { 
    System.out.println("I am a dog."); 
}

    public void wagTail() { 
    System.out.println("I am wagging my tail."); 
} 
} 

    public class Test5 { 
    public static void main(String[] args) { 
    Animal a = new Dog(); 
    a.speak(); 
     ((Dog) a).wagTail();
} 
}
